package com.day08.ex01;

import java.util.Scanner;

public class StringTest01 {
    public static void main(String[] args) {
        String username="itheima";
        String password="czbk";
        for (int i = 0; i <3 ; i++) {
            Scanner sc= sc=new Scanner(System.in);
            System.out.println("请输入用户名");
            String name=sc.next();
            System.out.println("请输入密码");
            String pwd=sc.next();
            if(username.equals(name)&&password.equals(pwd)){
                System.out.println("登录成功");
                break;
            }else{
                if(2-i==0){
                    System.out.println("你的账户被锁定，请与管理员联系");
                }else {
                    System.out.println("登陆失败，你还有"+(2-i+"次机会"));
                }
            }
        }
    }
}
